package com.neusoft.ysu.populationmanagement.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.neusoft.ysu.populationmanagement.vo.VResPop;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author 作者：赵子鉴
 * @since 2024-06-18
 */
@Data
public class Household implements Serializable {

    private static final long serialVersionUID = 1L;

    public Household(){}
    public Household(VResPop vResPop, OperationLog operationLog){
        this.holderId  = vResPop.getId();
        this.housetypeId = vResPop.getHousetypeId();
        this.pid = operationLog.getPid();
        this.housenum = vResPop.getHousenum();
    }
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    private Long housetypeId;
    private Long pid;
    private String housenum;
    private Long holderId;



    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    private LocalDate setdate;


    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    private Integer isDelete;

}
